package com.bank.basic.service.impl;

import com.bank.basic.service.FileService;
import com.bank.basic.service.NoticeService;
import com.bank.basic.util.ClientFactory;
import com.bank.basic.util.EntityFactory;
import com.bank.basic.util.MapperFactory;
import com.bank.basic.util.VoFactory;
import com.bank.model.entity.Notice;
import com.bank.model.vo.notice.NoticeAddVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Cejay1314
 * @version 1.0
 * @create 2023/4/13 14:49
 */
@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    MapperFactory mapperFactory;
    @Autowired
    EntityFactory entityFactory;
    @Autowired
    VoFactory voFactory;
    @Autowired
    ClientFactory clientFactory;
    @Autowired
    FileService fileService;



    @Override
    public List<Notice> query() {
        return mapperFactory.getNoticeMapper().selectList(null);
    }

    @Override
    public void add(NoticeAddVo noticeAddVo) {
        Notice notice = entityFactory.getNotice(noticeAddVo);
        mapperFactory.getNoticeMapper().insert(notice);
    }
}
